package com.godofgamblers.hotelmanagementsystem.handler;

import com.godofgamblers.hotelmanagementsystem.pojo.Order;
import com.godofgamblers.hotelmanagementsystem.pojo.Order_item;
import com.godofgamblers.hotelmanagementsystem.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * 线下支付类
 */
@Controller
@RequestMapping("/OfflinePay")
public class OfflinePayHandler {
    @Autowired
    private OrderService orderService;

    private ModelAndView modelAndView = new ModelAndView();
    /**
     * 线上预定支付
     * @param order 订单pojo类
     * @return ModelAndView
     */
    @RequestMapping("/pay")
    @ResponseBody
    public String Pay(Order order, Order_item order_item){
        String result="支付失败！";
        //修改订单状态
        result = orderService.onlineBookingPay(order,order_item);
        return result;
    }
}
